home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1987 August / Ahoy_Magazine_87-08_1987_Double_L_Side_A.d64 / Polygon Play (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  628b  |  22 lines

  1. 0 poke646,0:poke53280,12:poke53281,12
  2. 1 rem ==================================
  3. 2 rem commodares problem #40-3 :
  4. 3 rem    polygon play
  5. 4 rem solution by
  6. 5 rem    joe steininger
  7. 6 rem ==================================
  8. 10 print"[147]how many sides"
  9. 20 input n:if n<3 goto 20
  10. 30 print"length of each side, in meters"
  11. 40 input l
  12. 50 a=((n-2)/n)*180
  13. 60 s=a*n
  14. 70 r=(l/2)*(1/tan((NULL)/n))
  15. 80 d=(l/2)*(1/sin((NULL)/n))
  16. 90 y=n*(l^2)/4*(1/tan((NULL)/n))
  17. 100 print"interior angles are ";a;"degrees each":print
  18. 110 print"sum of interior angles is ";s;"degrees":print
  19. 120 print"the area is ";y;"square meters":print
  20. 130 print"inscribed radius is ";r;"meters":print
  21. 140 print"circumscribed radius is ";d;"meters":print:print
  22.